// components/agent/agent.js
import Https from "./../../utils/api.js"
const http = new Https
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    // agent:Array
  },

  /**
   * 组件的初始数据
   */
  data: {
    agent: []
  },
  // observers:{
  //   "agent":function(val){
  //     console.log(val)
  //   }
  // },
  created() {

    http.request('agent/list').then(res => {
      console.log(res)
        this.setData({
          agent: res.data.data
        })
    })
  },
  /**
  * 组件的方法列表
  */
  methods: {
    go(e) {
      let id = e.currentTarget.dataset.id;
      wx.navigateTo({
        url: '/pages/home/agentDesc/agentDesc?id=' + id,
      })
    }
  },
})
